package com.example.featuresdk.core

import android.content.Context
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.navigation.NavGraphBuilder
import androidx.navigation.NavHostController
import com.example.featuresdk.navigation.INavigationAware
import com.example.featuresdk.navigation.INavigationController

abstract class AbstractFeatureSDK: INavigationAware {

    var context: Context? = null

    /**
     * whether the feature is entitled to the user according to user profile
     */
    var userEntitled: Boolean = false

    //abstract fun featureEntry() : FeatureEntry
    abstract fun featureKey(): String
    abstract fun featureDesc(): String
    abstract fun featureIcon(selected: Boolean): Int

//    /**
//     * the feature entry UI
//     */
//    @Composable
//    open fun FeatureEntryView(selected: Boolean = false) {
//        Text(text ="*****Default FeatureEntryView Composable********It Does Not Work!!!")
//        //java.lang.NoSuchMethodError: No virtual method FeatureEntryView(ZLandroidx/compose/runtime/Composer;II)V in class Lcom/example/featuresdk/core/AbstractFeatureSDK;
//    }

    @ExperimentalFoundationApi
    abstract fun buildNavigationGraph(navGraphBuilder: NavGraphBuilder, navHostController: NavHostController)

    abstract fun getNavigationController(): INavigationController

    override fun onEnter() {

    }

    override fun onResume() {

    }

    override fun onExit() {

    }

    override fun backable(): Boolean {
        return false
    }

    override fun back() {

    }
}
